package com.sudo.dao.base;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sudo.common.annotation.mybatis.CreateBy;
import com.sudo.common.annotation.mybatis.CreateTime;
import com.sudo.common.annotation.mybatis.UpdateBy;
import com.sudo.common.annotation.mybatis.UpdateTime;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Author：DayDayUp
 * @Create：2023/3/20 16:23
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseEntity implements Serializable {

    @CreateTime
    @Column(name = "create_time")
    public LocalDateTime createTime;

    @UpdateTime
    @Column(name = "update_time")
    public LocalDateTime updateTime;

    @CreateBy
    @Column(name = "create_by")
    public String createBy;

    @UpdateBy
    @Column(name = "update_by")
    public String updateBy;

    public interface Field{
        String createBy = "createBy";
        String createTime = "createTime";
        String updateBy = "updateBy";
        String updateTime = "updateTime";
    }
}
